import { request } from '@/utils/request.js'

/**
 * 货箱 API JS
 */

export default {

  /**
   * 获取货箱分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'document/parcel/index',
      method: 'get',
      params
    })
  },

  /**
   * 获取货箱列表无分页
   * @returns
   */
  getAllList (params = {}) {
    return request({
      url: 'document/parcel/list',
      method: 'get',
      params
    })
  },

  //获取货箱列表
  getWaybillList (params = {}) {
    return request({
      url: 'document/shipmentWaybillParcel/index',
      method: 'get',
      params
    })
  },
  //获取提单下所有运单
  waybillShipment (params = {}) {
    return request({
      url: 'document/waybill/shipment',
      method: 'get',
      params
    })
  },
  //获取申报列表
  viewParcelDeclaration (params = {}) {
    return request({
      url: 'document/parcelDeclaration/viewParcelDeclaration',
      method: 'get',
      params
    })
  },
  
  //获取发货列表
  getDeliveryList (params = {}) {
    return request({
      url: 'document/shipmentDeliveryParcel/index',
      method: 'get',
      params
    })
  },
  
  /**
   * 添加货箱
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'document/parcel/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新货箱数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'document/parcel/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取货箱
   * @returns
   */
  read (id) {
    return request({
      url: 'document/parcel/read/' + id,
      method: 'get',
      data
    })
  },
  /**
   * 读取货箱
   * @returns
   */
  readOne (number,data={}) {
    return request({
      url: 'document/parcel/readOne/' + number,
      method: 'post',
      data
    })
  },

  /**
   * 将货箱删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'document/parcel/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取货箱数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'document/parcel/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复货箱数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'document/parcel/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除货箱
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'document/parcel/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 更改货箱数据
   * @returns
   */
  changeStatus (data = {}) {
    return request({
      url: 'document/parcel/changeStatus',
      method: 'put',
      data
    })
  },

  /**
   * 拣货
   * @returns
   */
  pickup (data = {}) {
    return request({
      url: 'document/parcel/pick',
      method: 'post',
      data
    })
  },

  /**
   * 拣货
   * @returns
   */
  fba (data = {}) {
    return request({
      url: 'document/parcel/fba',
      method: 'post',
      data:{parcel:data}
    })
  },

  /**
   * 转单号
   * @returns
   */
  turn (data = {}) {
    return request({
      url: 'document/parcel/turn',
      method: 'post',
      data:{parcel:data}
    })
  },

  /**
   * 取消
   * @returns
   */
  cancel (data = {}) {
    return request({
      url: 'document/parcel/cancel',
      method: 'post',
      data
    })
  },

  /**
   * 重新发货
   * @returns
   */
  resend (data = {}) {
    return request({
      url: 'document/parcel/resend',
      method: 'post',
      data
    })
  },

  /**
   * 获取UPS
   * @returns
   */
  getUps (data = {}) {
    return request({
      url: 'document/parcel/getUps',
      method: 'post',
      data
    })
  },



}